package com.example.aboutwork.controller;

import com.example.aboutwork.bean.BeanSet;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/bean/set/")
public class BeanSetController {

    @Autowired
    BeanSet beanSet;

    @PostMapping("name")
    public Object setName(String name) {
        beanSet.setName(name);
        return beanSet;
    }

    @PostMapping("age")
    public Object setAge(String age) {
        beanSet.setAge(Integer.parseInt(age));
        return beanSet;
    }

}
